<?php
/**
 * ThemeFile.php
 * 
 * @category    Madoqua
 * @package     View
 * @subpackage  Helper
 */

/**
 * base class
 */
require_once 'Madoqua/View/Helper/Abstract.php';

/**
 * Madoqua_View_Helper_ThemeFile
 * 
 * @category    Madoqua
 * @package     View
 * @subpackage  Helper
 */
class Madoqua_View_Helper_ThemeFile extends Madoqua_View_Helper_Abstract
{
    /**
     * fetch a url to a theme file
     *
     * @param string $file
     * @param string $theme
     * @return string
     */
    public function themeFile($file, $theme = null)
    {
        if ($theme === null) {
            $theme = Madoqua_Application::getConfiguration()->theme->active;
        }
        //fetch currently active theme by default

        $options = array(
            'theme' => $theme,
            'file' => $file
        );
        
        return $this->_view->url($options, 'theme_file', true);
        //assemble url and return it
    }
}